import Vue from 'vue'
import Web3 from 'web3'
import {
  Card,
  Message,
  Image,
  Dialog,
  Tag,
  Icon,
  Row,
  Col,
  Timeline,
  TimelineItem,
  Divider,
  InfiniteScroll,
  Table,
  TableColumn,
  Form,
  FormItem,
  Input,
  Button,
  Select,
  Option,
  Drawer,
  Popover,
  Upload,
  Tooltip,
  Radio,
  Switch,
  Checkbox,
  Carousel,
  CarouselItem,
  Backtop,
  Tabs,
  TabPane,
  Step,
  Steps,
} from 'element-ui'

import locale from 'element-ui/lib/locale/lang/en'

const components = [
  Card,
  Message,
  Image,
  Dialog,
  Tag,
  Icon,
  Row,
  Col,
  Timeline,
  TimelineItem,
  Divider,
  Table,
  TableColumn,
  Form,
  FormItem,
  Input,
  Button,
  Select,
  Option,
  Drawer,
  Popover,
  Upload,
  Tooltip,
  Radio,
  Switch,
  Checkbox,
  Carousel,
  CarouselItem,
  Backtop,
  Tabs,
  TabPane,
  Step,
  Steps,
]

const Element = {
  install(Vue: any) {
    components.forEach((component) => {
      Vue.component(component.name, component)
    })
  },
}
Vue.use(InfiniteScroll)
Vue.use(Element, { locale })
Vue.prototype.$Web3 = Web3